import pandas as pd
import matplotlib.pyplot as plt

# 读取csv文件
data = pd.read_csv('C:/Users/xuchuanliangbt/Desktop/ai数据分析/原始数据备份/第五批数据/12V0.96A11.48W2024年01月31日14时57分34秒.csv')
# 分别获取每一列数据
index = data['index']
electricity = data['electricity']
activePower = data['activePower']
reactivePower = data['reactivePower']
apparentPower = data['apparentPower']
currentAngle = data['currentAngle']
fundamentalPowerFactor = data['fundamentalPowerFactor']
fullWavePowerFactor = data['fullWavePowerFactor']
# 绘制折线图
plt.plot(index,electricity,activePower,reactivePower,apparentPower,currentAngle,fundamentalPowerFactor,fullWavePowerFactor)
# 设置图表标题和横纵坐标名称
plt.title('标题')
plt.xlabel('序号')
plt.ylabel('数值')

# 显示图表
plt.show()
